﻿<catel:UserControl x:Class="Catel.Examples.WPF.ViewModelLifetime.Views.ControlView"
                   xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                   xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
				   xmlns:catel="http://catel.codeplex.com">
    
    <!-- Resources -->
    <UserControl.Resources>

    </UserControl.Resources>

    <!-- Content -->
    <Grid>
        <catel:StackGrid HorizontalAlignment="Center" VerticalAlignment="Center">
            <catel:StackGrid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
            </catel:StackGrid.RowDefinitions>
            
            <catel:StackGrid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
            </catel:StackGrid.ColumnDefinitions>

            <Label Content="This is a tab control item. Close the view model when unloaded: " />
            <Label Content="{Binding RelativeSource={RelativeSource AncestorType={x:Type UserControl}}, Path=CloseViewModelOnUnloaded}" />

            <Label Content="View model construction time:" />
            <Label Content="{Binding ViewModelConstructionTime}" ContentStringFormat="At {0:HH:mm:ss.fff}" />
        </catel:StackGrid>
    </Grid>
</catel:UserControl>
